package utils

import (
	"encoding/json"
	"fmt"
)

func FormatJSONPretty(value interface{}) string {
	result, err := json.MarshalIndent(value, "", " ")
	if err != nil {
		panic(fmt.Errorf("FormatJSONPretty failed, %w", err))
	}
	return string(result)
}

func FormatJSON(value interface{}) string {
	result, err := json.Marshal(value)
	if err != nil {
		panic(fmt.Errorf("FormatJSON failed, %w", err))
	}
	return string(result)
}
